# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Rob Til Freedmen <rob.til.freedman@gmail.com>
# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
# Contributor: Robert Emil Berge

_name=ladspa
pkgname=swh-plugins
pkgver=0.4.17
pkgrel=5
pkgdesc="Steve Harris' LADSPA plug-ins suite"
arch=(loong64 x86_64)
url="http://plugin.org.uk/"
license=(GPL-2.0-or-later)
depends=(
  fftw
  glibc
  gsm
  ladspa-host
)
makedepends=(
  ladspa
  libxml2
  perl-xml-parser
)
groups=(
  ladspa-plugins
  pro-audio
)
source=(
  $pkgname-$pkgver.tar.gz::https://github.com/swh/$_name/archive/v$pkgver.tar.gz
  $pkgname-0.4.17-use_system_gsm.patch
)
sha512sums=('6b566030b43c3929ce8938648abd458efa0fea0b4916410a34b4f4fa788c45e4a6ec3f46ca435f8546179ff0c4674303db22314e1c1f1d09e5f2b71e6c5aecc7'
            '7080a115442d682bdad17b2bfa2694ba5f6ef53efcd214748fe26133dda6a79726f57e34819e2324d1bf0a999baf5c895cba488658cc9695d4903755dce5774f')

prepare() {
  cd $_name-$pkgver
  # patching to use system gsm library
  patch -Np1 -i ../$pkgname-0.4.17-use_system_gsm.patch
  autoreconf -fiv
}

build() {
  cd $_name-$pkgver
  ./configure --prefix=/usr
  # prevent excessive overlinking due to libtool
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd $_name-$pkgver
  make DESTDIR="$pkgdir/" install
  install -vDm 644 {AUTHORS,ChangeLog,NEWS,README,TODO} -t "$pkgdir/usr/share/doc/$pkgname/"
}

# vim:set ts=2 sw=2 et:
